/**
* @author Meng Zhang
**/

#pragma once

#include <vector>
class IEventHandler;
class CMainFrame;

class CMenuManager : public CCmdTarget
{
	DECLARE_DYNAMIC(CMenuManager)

public:
	CMenuManager();
	virtual ~CMenuManager();

	CMenu& GetMenu();

	void Initialize();
	void Destroy();
	
	UINT RegisterCommand(IEventHandler* eventHandler);
	void ReleaseCommand(UINT nCmd);

private:
	CMainFrame *mainFrm;
	std::vector<IEventHandler*> handlers;
	UINT newCommand();	
	
protected:
	DECLARE_MESSAGE_MAP()
	afx_msg void Command(UINT nCmd);
	afx_msg void UpdateCommandUI(CCmdUI *pCmdUI);
};
